﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
    	<title>Job定义列表</title>
<jsp:include page="common/header.jsp"/>
	</head>
	<body>
<jsp:include page="common/body-header.jsp"/>
		<form action="job-confs.action" method="post">
		<table>
			<tr>
				<th align="left">Catalogs</th>
				<th align="left">Job Configurations</th>
			</tr>
			<tr>
				<td valign="top" width="150">
					<a href="job-confs.action">all<c:if test="${catalog==0}">&lt;</c:if></a><br>
<c:forEach var="cat" items="${catalogs}">
					<a href="job-confs.action?catalog=${cat.id}" title="${cat.description}">${ss:getCatalogDeepName(catalogController, cat)}<c:if test="${catalog==cat.id}">&lt;</c:if></a><br>
</c:forEach>
				</td>
				<td valign="top"><table>
					<tr>
						<th>&nbsp;</th>
						<th>Job Configuration Id</th>
						<c:if test="${catalog==0}"><th>Catalog</th></c:if>
						<th>Type</th>
						<th>Name</th>
						<th>Description</th>
						<th>Parameters</th>
						<th>Owner</th>
						<th>CreateTime</th>
						<th>ModifyTime</th>
						<th>Modifier</th>
						<th>Avg.Time</th>
						<th>Action</th>
					</tr>
					<c:forEach var="conf" items="${confs}">
					<tr>
						<td><input type="checkbox" name="identifiers" value="${conf.identifier.stringIdentifier}"></td>
						<td><a href="job-conf.action?action=view&identifier=${conf.identifier.stringIdentifier}">${conf.identifier.stringIdentifier}</a></td>
						<c:if test="${catalog==0}"><td><a href="job-confs.action?catalog=${conf.catalog}">${ss:getCatalogName(catalogController, conf.catalog)}</a></td></c:if>
						<td>${conf.type}</td>
						<td>${conf.name}</td>
						<td>${conf.description}</td>
						<td>${conf.parameterSize}</td>
						<td>${conf.owner}</td>
						<td>${ss:dateFormat(conf.createTime)}</td>
						<td>${ss:dateFormat(conf.modifyTime)}</td>
						<td>${conf.modifier}</td>
						<td>${ss:timeBetween(conf.averageRunTime, -1)}</td>
						<td>
							<a href="run-job-conf.action?identifier=${conf.identifier.stringIdentifier}"><img alt="执行" src="images/icons/play.png" title="执行"></a>
							<a href="job-conf.action?action=edit&identifier=${conf.identifier.stringIdentifier}<c:if test="${catalog!=0}">&catalog=${catalog}</c:if>"><img alt="修改" src="images/icons/edit.png" title="修改"></a>
							<a href="job-conf.action?action=create&identifier=${conf.identifier.stringIdentifier}&catalog=${conf.catalog}"><img alt="以此为模板创建" src="images/icons/add.png" title="以此为模板创建"></a>
						</td>
					</tr>
					</c:forEach>
				</table></td>
			</tr>
			<tr>
				<td colspan="2">
					<c:if test="${message!=null}"><div style="color: red;">${message}</div></c:if>
					<input type="hidden" name="change">
					<c:if test="${catalog!=0}">
						<input type="hidden" name="catalog" value="${catalog}">
						<c:if test="${fn:length(catalogs)>1 && fn:length(confs)>0}">
							<select name="targetCatalog"><c:forEach var="cat" items="${catalogs}">
								<c:if test="${catalog!=cat.id}"><option value="${cat.id}"<c:if test="${targetCatalog==cat.id}"> selected="selected"</c:if>>${ss:getCatalogDeepName(catalogController, cat)}</option></c:if>
							</c:forEach></select>
							<input type="submit" value="Change Catalog" onclick="this.form.change.value='changeCatalog'">
						</c:if>
					</c:if>
					<a href="job-conf.action?action=create<c:if test="${catalog!=0}">&catalog=${catalog}</c:if>">Add New Job Configuration</a>
				</td>
			</tr>
		</table>
		</form>
<jsp:include page="common/body-footer.jsp"/>
	</body>
</html>
